<!--
*Author：DGZ
 **  contact:service@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demoproject/masterdata/md_machine_types.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/demoproject/masterdata/md_machine_types.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'id',
                editTable:true ,
                footer: "Foots",
                cnName: '设备类型',
                name: 'masterdata/md_machine_types',
                newTabEdit: false,
                url: "/md_machine_types/",
                sortName: "CreateDate,TypeCode,TypeName"
            });
            const editFormFields = ref({"ParentID":"","TypeCode":"","TypeName":"","TypeDesc":""});
            const editFormOptions = ref([[{"title":"上阶设备类型ID","field":"ParentID"}],
                              [{"title":"设备类型代码","field":"TypeCode"}],
                              [{"title":"设备类型名称","field":"TypeName"}],
                              [{"title":"设备类型说明","field":"TypeDesc"}]]);
            const searchFormFields = ref({"TypeCode":"","TypeName":"","TypeDesc":""});
            const searchFormOptions = ref([[{"title":"设备类型代码","field":"TypeCode","type":"like"},{"title":"设备类型名称","field":"TypeName","type":"like"},{"title":"设备类型说明","field":"TypeDesc","type":"like"}]]);
            const columns = ref([{field:'id',title:'ID',type:'string',width:120,hidden:true,require:true,align:'left'},
                       {field:'ParentID',title:'上阶设备类型ID',type:'string',width:120,edit:{type:''},align:'left'},
                       {field:'TypeCode',title:'设备类型代码',type:'string',link:true,width:120,edit:{type:''},align:'left'},
                       {field:'TypeName',title:'设备类型名称',type:'string',width:120,edit:{type:''},align:'left'},
                       {field:'TypeDesc',title:'设备类型说明',type:'string',width:110,edit:{type:''},align:'left'},
                       {field:'TypeSeq',title:'排序',type:'decimal',width:110,align:'left'},
                       {field:'MachineCount',title:'设备数',type:'decimal',width:110,align:'left'},
                       {field:'IsValid',title:'是否有效',type:'int',width:110,hidden:true,align:'left'},
                       {field:'Remarks',title:'备注',type:'string',width:150,align:'left'},
                       {field:'CreaterID',title:'创建人ID',type:'int',width:110,align:'left'},
                       {field:'Creator',title:'创建人',type:'string',width:100,align:'left'},
                       {field:'CreateTime',title:'创建时间',type:'datetime',width:110,align:'left'},
                       {field:'ModifyId',title:'修改人ID',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Modifier',title:'修改人',type:'string',width:100,align:'left'},
                       {field:'ModifyTime',title:'修改时间',type:'datetime',width:110,align:'left'}]);
            const detail = ref({columns:[]});
            const details = ref([]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
